package logic;

public class CountPassChecker implements PassChecker{
	private MetroCardPassLimit card;
        private CardDataBase cardDb;
	
	public CountPassChecker( MetroCardPassLimit metroCard, CardDataBase cardDataBase){
            card = metroCard;
            cardDb = cardDataBase;
	}

	@Override
	public boolean checkPass() {
            if ( cardDb.findCard(card)){
                if ( card.getPasses() > 0){
                    return card.pass();
                }
            }
            return false;
	}
	
	
}
